package com.wyx.suanfa;

import org.w3c.dom.Node;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 王艺锡
 * @version 1.0
 */
public class Npreorder {
    //给定一个 n 叉树的根节点  root ，返回 其节点值的 前序遍历 。
    public static void main(String[] args) {

    }
}
/*
*
// Definition for a Node.
class Node {
    public int val;
    public List<Node> children;

    public Node() {}

    public Node(int _val) {
        val = _val;
    }

    public Node(int _val, List<Node> _children) {
        val = _val;
        children = _children;
    }
};


class Solution {
    public List<Integer> preorder(Node root) {
        List<Integer> result = new ArrayList<>();
        if(root == null){
            return result;
        }
        circle(root,result);
        return result;

    }
    public void circle(Node root, List<Integer> result){
        if(root == null){
            return;
        }

        result.add(root.val);
        List<Node> children = root.children;
        if(children != null && children.size() != 0){
            for(Node child : children){
                circle(child,result);
            }
        }


    }
}*/
